#!/bin/bash
###
 # @Author: ipk518 18163976442@163.com
 # @Date: 2024-01-16 17:18:11
 # @LastEditors: ipk518 121206530@qq.com
 # @LastEditTime: 2024-03-08 16:32:21
 # @FilePath: /module-test/gdbServer.sh
 # @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
### 




set -e 
set -u

function main()
{
    echo "auto installing..."

    local application="moduleTest.elf"
    local dstUrl="admin@192.168.12.138:~/ts"
    local sshUrl="admin@192.168.12.138"
    local currentPath=$(cd $(dirname ${0}); pwd)
    local passwd="root"

    
    cd /home/ipk518/linux/a40i/module-test/build
    export PATH=$PATH:/home/ipk518/linux/tools/gcc-arm-linux-gnueabihf/bin
    make

    echo ${passwd} | scp -r ${currentPath}/bin/debug/${application} ${dstUrl}
    echo ${passwd} | scp -r ${currentPath}/lib/arm/*.so ${dstUrl}
    echo ${passwd} | scp -r ${currentPath}/conf/*.conf ${dstUrl}

    echo "auto install done."

   echo "auto gdbServer..."

 #   echo ${passwd} |  ssh ${sshUrl}
    
}

main ${@}